//
//  LKResetSecrectViewController.m
//  LKIntelligentVideoProject
//
//  Created by RB8 on 2018/12/14.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKResetSecrectViewController.h"

@interface LKResetSecrectViewController ()
@property (weak, nonatomic) IBOutlet UITextField *oldScrectTf;
@property (weak, nonatomic) IBOutlet UITextField *secretTf;

@property (weak, nonatomic) IBOutlet UIButton *sureBtn;

@end

@implementation LKResetSecrectViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.sureBtn.layer.cornerRadius = 25;
    self.sureBtn.layer.masksToBounds = YES;
    self.navigationItem.title = @"修改密码";
    self.view.backgroundColor = [UIColor grayColor];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)sureAction:(id)sender {
    if ([NSString isBlankString:self.oldScrectTf.text] ) {
        [SVProgressHUD showInfoWithStatus:@"请输入旧密码"];
        return;
    }
    if ([NSString isBlankString:self.secretTf.text] ) {
        [SVProgressHUD showInfoWithStatus:@"请输入新密码"];
        return;
    }
    NSDictionary *param = @{@"oldPwd":self.oldScrectTf.text,@"loginPwd":self.secretTf.text,@"id":[LKUserInforTool account].Id};
    [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerUrl apiPath:@"/hikUser/server/app/editAppPwd" parameters:param progress:^(NSProgress * _Nullable progress) {
        
    } success:^(BOOL isSuccess, id  _Nullable responseObject) {
        if ([responseObject[@"code"] integerValue] == 0000) {
            [LKUserInforTool noAccount];
            [LKSwitchRootVcTool switchRootController];
        }

    } failure:^(NSString * _Nullable errorMessage) {
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
